<%@page pageEncoding = "utf-8" contentType = "text/html;charset=utf-8"%>

<%@taglib prefix = "c" uri = "http://java.sun.com/jsp/jstl/core"%>
<%@taglib prefix = "fmt" uri = "http://java.sun.com/jsp/jstl/fmt"%>
<%@taglib prefix = "fn" uri = "http://java.sun.com/jsp/jstl/functions"%>

<c:set var="count" value="0" scope="page"/>

<h2><fmt:message key = "form.addTaskReport"/></h2>

<div class = "messages"><jsp:include page = "/messages.jsp"/></div>

<form action = "${sessionScope.alias}" method = "post" name = "taskForm">
<table class = "form">                               
  <tr>
    <td class = "label"><fmt:message key = "task.report"/><span class="star">*</span></td>
    <td><textarea name = "text" rows="10" cols="50"><c:out value = "${taskBean.executorReport}"/></textarea></td>
  </tr>
</table>
     
<input name = "_action" type = "hidden" value = "processTaskReportForm">   
<input name = "task_id" type = "hidden" value='<c:out value="${taskBean.id}"/>'>   
<input name = "request_id" type = "hidden" value='<c:out value="${taskBean.requestId}"/>'>   
     

<input type="submit" value='<fmt:message key = "Command.SaveReport"/>'>
или
<a href = "${sessionScope.alias}?_action=taskDetails&task_id=${taskBean.id}">
   <fmt:message key = "Command.cancel"/>
</a>       
</form>      

<h2>Отчеты исполнителей</h2>

<table class = "form">

<c:forEach var = "task" items = "${tasksList}">
<c:if test="${task.id != taskBean.id && task.executorReport!=null}">
  <tr>
    <td class="label"><c:out value = "${task.executor.lastName}"/>&nbsp;<c:out value = "${task.executor.firstName}"/></td>
    <td><c:out value = "${task.executorReport}"/></td>
    <c:set var="count" value="${count + 1}" scope="page"/>
  </tr>
</c:if>

</c:forEach>

<c:if test="${count == 0}">
   <tr><td align="center">Отчетов нет</td></tr>
</c:if>

</table>